package com.zzyl.nursing.controller.member;

import com.zzyl.common.core.domain.R;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.nursing.domain.NursingProject;
import com.zzyl.nursing.service.INursingProjectService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: ZHD
 * @Date: 2025/08/27 19:53
 * @Description:
 */
@RestController
@RequestMapping("/member/orders/project")
@Api(tags="服务项接口")
public class MemberOrdersController {

   @Autowired
   private INursingProjectService nursingProjectService;
    /**
     * 分页查询
     * @param pageNum  页码
     * @param pageSize 每页数量
     * @param name  项目名称
     * @param status  状态
     * @return 分页列表
     */
    @GetMapping("/page")
    @ApiOperation("分页查询护理项目列表")
    public TableDataInfo<NursingProject> page(Integer pageNum, Integer pageSize, String name, Integer status) {
        return nursingProjectService.pageByNameAndStatus(pageNum, pageSize, name, status);
    }
    /**
     * 根据id查询
     * @param id  项目id
     * @return  项目详情
     */
    @ApiOperation("根据id查询护理项目详情")
    @GetMapping("/{id}")
    public R<NursingProject> selectNursingProjectById(@PathVariable Long id){
        return R.ok(nursingProjectService.selectNursingProjectById(id));
    }
}
